import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import App from './App.vue'
import router from './router'
import { axios } from './utils/http'
import api from './utils/api'
import common from './utils/common'
import './utils/filter' // 过滤
import md5 from './assets/js/md5'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' // 默认主题
import '../src/assets/css/main.css'
import './assets/css/icon.css'

import './assets/css/index2.css'
import './assets/css/index_c3238.css'
import './assets/css/category_f67bd.css'
import './assets/css/index_index.css'

import './assets/css/headerStyle.css'
import './assets/css/footerStyle.css'

import './assets/css/index_mobile.css'
import './assets/css/icon.css'

// import style
import 'swiper/css/swiper.css'
import './assets/css/swipper2.css'
import echarts from 'echarts'

Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

Vue.use(ElementUI, {
  size: 'small'
})

Vue.use(VueAwesomeSwiper, /* { default options with global component } */)

Vue.prototype.API = api
Vue.prototype.common = common
Vue.prototype.$axios = axios
Vue.prototype.MD5 = md5
// Vue.prototype.uploadHeader = uploadHeader
//使用钩子函数对路由进行权限跳转
// router.beforeEach((to, from, next) => {
  // const token = localStorage.getItem('token')
  // if (to.meta.requireAuth && !token) {
  //   next({
  //     path: '/login'
  //   })
  //   return
  // }
  // if (!token && to.path !== '/login') {
  //   next({
  //     path: '/login',
  //     query: { redirect: to.fullPath } // 将要跳转路由的path作为参数，传递到登录页面
  //   })
  // } else {
  //   next()
  // }
// })
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
